form.ui.form.loading.invisible#product method="post" action="/admin/product_as" accept-charset="UTF-8" enctype="multipart/form-data" name="base_form"
  .ui.segment
    .fields v-model="product"
      .inline.field
        label 名称
        input type='text' name='product_a[name]' value="{{product.name}}"
        input type='hidden' name='product_a[user_id]' value="#{current_user.id}"
      .inline.field
        label 发布时间
        input type='date' name='product_a[published_at]' value="{{product.published_at}}"
      .inline.field
        label 类别
        select.ui.dropdown name='product_a[category]' v-model="product.category"
          - ProductA.category.values.each do |category|
              option value=category =t('activerecord.attributes.product.category.' + category.downcase)
    .field
      img src='{{product.logo.url}}'
      label LOGO
      input type='file' name='product_a[logo]'
    .fields
      .inline.field
        label 简介
        input type='text' name='product_a[summary]' value="{{product.summary}}"
      .inline.field
        label 网址
        input type='text' name='product_a[url]' value="{{product.url}}"
    .field
      label 描述
      textarea name='product_a[description]' value="{{product.description}}"

  .ui.segment
    .field
      label 截图(点击图片删除)
    .ui.small.images
      a v-on="click: deleteScreen(screenshot)" v-repeat="screenshot in product.screenshots"
        img.ui.image src='{{screenshot.file.url}}'
        input type='hidden' name='screenshots[]' value="{{screenshot.id}}"
    .ui.small.image#add-image-button
    .field
      input#file_data type='file' name='product_a[screenshots][]' multiple='multiple' v-on="change: sendScreen"

  .ui.segment
    .fields
      .field
        label 创始团队
        input type='hidden' name='product_a[founders][]' value='' v-if="product.founders == ''"
    .fields v-repeat="founder in product.founders"
      .inline.field
        label 姓名
        input type='text' name='product_a[founders][][name]' value='{{founder.name}}'
      .inline.field
        label 职位
        input type='text' name='product_a[founders][][position]' value='{{founder.position}}'
      .inline.field
        label 邮箱
        input type='text' name='product_a[founders][][email]' value='{{founder.email}}'
      .inline.field
        label 电话
        input type='text' name='product_a[founders][][mobile]' value='{{founder.mobile}}'
      .inline.field
        label &nbsp;
        a.ui.red.button v-on="click: deleteFounders(founder)"
          | 删除
    .field
      a.ui.blue.button v-on="click: addFounders"
        | 添加

  .ui.segment
    .fields
      .field
        label 融资情况
        input type='hidden' name='product_a[financings][]' value='' v-if="product.financings == ''"
    .fields v-repeat="financing in product.financings"
      .inline.field
        label 融资阶段
        select.ui.dropdown name='product_a[financings][][stage]' v-model="financing.stage"
          - %w(天使轮 A轮 B轮 C轮 D轮 已上市).each do |stage|
            option value=stage =stage
      .inline.field
        label 融资数目
        input type='text' name='product_a[financings][][amount]' value="{{financing.amount}}"
      .inline.field
        label 投资机构
        input type='text' name='product_a[financings][][invertor]' value="{{financing.invertor}}"
      .inline.field
        label 时间
        input type='date' name='product_a[financings][][date]' value="{{financing.date}}"
      .inline.field
        label &nbsp;
        a.ui.red.button v-on="click: deleteFinancings(financing)"
          | 删除
    .field
      a.ui.blue.button v-on="click: addFinancings"
        | 添加

  .ui.segment
    .fields
      .field
        label 联系人
        input type='hidden' name='product_a[contacts][]' value='' v-if="product.contacts == ''"
    .fields v-repeat="contact in product.contacts"
      .inline.field
        label 姓名
        input type='text' name='product_a[contacts][][name]' value='{{contact.name}}'
      .inline.field
        label 职位
        input name='product_a[contacts][][position]' value='{{contact.position}}'
      .inline.field
        label 邮箱
        input name='product_a[contacts][][email]' value='{{contact.email}}'
      .inline.field
        label 电话
        input name='product_a[contacts][][mobile]' value='{{contact.mobile}}'
      .inline.field
        label &nbsp;
        a.ui.red.button v-on="click: deleteContacts(contact)"
          | 删除
    .field
      a.ui.blue.button v-on="click: addContacts"
        | 添加

  .ui.segment
    .fields
      .field
        label 合作记录
        input type='hidden' name='product_a[cowork_records][]' value='' v-if="product.cowork_records == ''"
    .fields v-repeat="record in product.cowork_records"
      .inline.field
        label 合作形式
        select.ui.dropdown name='product_a[cowork_records][][mode]' v-model="record.mode"
          - %w(广告合作 媒体合作 品牌置换 加速合作).each do |mode|
            option value=mode =mode
      .inline.field
        label 公园对接人
        input name='product_a[cowork_records][][staff]' value='{{record.staff}}'
      .inline.field
        label 时间
        input type='date' name='product_a[cowork_records][][date]' value='{{record.data}}'
      .inline.field
        label 备注
        input name='product_a[cowork_records][][note]' value='{{record.note}}'
      .inline.field
        label &nbsp;
        a.ui.red.button v-on="click: deleteRecords(record)"
          | 删除
    .field
      a.ui.blue.button v-on="click: addRecords"
        | 添加

  .ui.segment
    .fields
      .field
        label 编辑评价
        input type='hidden' name='product_a[editor_comments][]' value='' v-if="product.editor_comments == ''"
    .segment_a v-repeat="comment in product.editor_comments"
      .fields
        .fields
          .inline.field
            label 编辑
            input name='product_a[editor_comments][][editor]' value='{{comment.editor}}'
          .inline.field
            a.ui.red.button v-on="click: deleteEditComments(comment)"
              | 删除
      .field
        label 评价
        textarea name='product_a[editor_comments][][comment]' value='{{comment.comment}}'
    .field
      a.ui.blue.button v-on="click: addEditComments"
        | 添加

  .ui.segment
    .inline.field
      a.ui.blue.button.dib-middle.js-loading v-on="click: sendData"
        | 提交
      .send-success-container.dib-middle
        p.js-send-success.move_left 提交成功

.ui.modal#error_message
  .header 创建失败
  .content.ui.list
    li v-repeat="error in errors"
      | {{error}}
